feat: consolidate 1.21-1.21.5, 1.21.6-1.21.11, 26.1.x, 26.2 support into one Stonecutter source tree#20
Merged
Conversation
Migrates the mod from 3 separate branches (main 26.1, support/1.21-1.21.5, support/1.21.6-1.21.11) to a single source tree using Stonecutter 0.9.3. - All variants now use Mojang official mappings (yarn sources for the support branches were converted with loom's migrateMappings task). - Per-version gradle.properties under versions/ pin MC, fabric-api, modmenu, cloth-config, loader, and target Java version. - Single root build.gradle uses stonecutter.eval(...) to switch between fabric-loom (26.1, unobfuscated) and fabric-loom-remap (1.21.x, obfuscated). - Source files use //? if mc directives where the API genuinely differs: HudElementRegistry vs HudRenderCallback, Identifier vs ResourceLocation, GuiGraphicsExtractor vs GuiGraphics, drawContext.text vs .drawString, Holder vs Optional<ResourceKey> in Biome lookup, FPS via accessor mixin on 1.21.x. The active VCS variant is 26.1 so 'git diff main' stays small. Co-authored-by: Dominic Seung <dominic@seung.dev>
- Stonecutter uses '//? if >=1.21.6 {' (no 'mc' keyword, no quotes around
versions) - my previous '//? if mc >= "..." {' format was rejected by the
parser.
- client.getFps() is public on all Mojang-mapped variants (1.21, 1.21.6+,
26.1), so the MinecraftClientAccessor mixin was redundant. Drop it and the
empty mixin/ package; betterhud.mixins.json keeps an empty client array via
expansion.
- Earlier I'd assumed 26.1 used getDebugHud()/hudHidden (yarn-like) names,
but main 26.1 already uses getDebugOverlay()/hideGui (true Mojang) - same
as the 1.21.x Mojang-migrated source. Removed the bogus directives that
swapped between them.
After these fixes, all three variants build successfully:
./gradlew build
-> versions/1.21/build/libs/betterhud-2.1.0+mc1.21.jar
-> versions/1.21.6/build/libs/betterhud-2.1.0+mc1.21.6.jar
-> versions/26.1/build/libs/betterhud-2.1.0+mc26.1.jar
CI workflow updated to a 3-way matrix (mc1.21/Java21, mc1.21.6/Java21,
mc26.1/Java25) that uploads each variant as a separate artifact.
Co-authored-by: Dominic Seung <dominic@seung.dev>
- Add four Stonecutter variants: 1.21 (1.21-1.21.5), 1.21.6 (1.21.6-1.21.11), 26.1 (>=26.1 <26.2), 26.2 (>=26.2). - All jars now declare fabric-api, modmenu, and cloth-config2 as hard runtime dependencies instead of bundling them (~47 KB jars vs ~2 MB before). - Port 26.2 scaling (Matrix3x2fStack / PoseStack transforms, scaledElement* layout helpers, Scale setting) to every variant via Stonecutter directives. - 26.2 uses client.gui.hud.isHidden(); all other variants use options.hideGui. - Update to mod 2.1.1, loom 1.17-SNAPSHOT, Gradle 9.5.1; CI matrix covers all four variants. Co-authored-by: Dominic Seung <dominic@seung.dev>
Merge origin/main into cursor/stonecutter-multiversion-b333, keeping the Stonecutter four-variant layout while incorporating main's 26.2 changes (scaling, required fabric-api/modmenu/cloth-config deps, gui.hud.isHidden). Resolved conflicts in build.gradle, gradle.properties, BetterHUDGUI.java, CustomText.java, ModSettings.java, fabric.mod.json, and removed a duplicate createFloatSetting() introduced by the auto-merge in Setting.java. Co-authored-by: Dominic Seung <dominic@seung.dev>
Merge origin/main; resolve build.yml conflict by keeping the four-variant Stonecutter matrix while adopting main's on: push trigger (no pull_request). Co-authored-by: Dominic Seung <dominic@seung.dev>
Use a single implCfg (modImplementation vs implementation) and only gate mappings loom.officialMojangMappings() behind isLegacy. Co-authored-by: Dominic Seung <dominic@seung.dev>
This reverts commit 0c7a2e1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Replaces the three-branch maintenance flow with a single Stonecutter source tree that builds four version-specific jars from
main:betterhud-2.1.1+mc1.21.jarbetterhud-2.1.1+mc1.21.6.jarbetterhud-2.1.1+mc26.1.jarbetterhud-2.1.1+mc26.2.jarEvery jar:
fabric-api,modmenu, andcloth-config2at runtime (no bundled deps — ~47 KB each).BetterHUDGUI, and the updated layout helpers (scaledElementWidth/scaledElementHeight).Build commands
Version-specific API differences (Stonecutter directives)
Only the lines that genuinely differ per MC version use
//? ifdirectives:HudRenderCallbackHudElementRegistryHudElementRegistry+IdentifierGuiGraphicsGuiGraphicsGuiGraphicsExtractordrawString()drawString()text()PoseStackMatrix3x2fStackMatrix3x2fStackoptions.hideGuigui.hud.isHidden()Optional<ResourceKey>HolderProject layout
After merge
The
support/1.21-*branches can be deleted. To add a future MC version, drop aversions/<ver>/gradle.propertiesand add it tosettings.gradle.